-- 获取文件名称
local filemane = vim.fn.expand("%:t")
filemane = string.gsub(filemane, "%..*", "")

return {
  "HakonHarnes/img-clip.nvim",
  event = "VeryLazy",
  opts = {
    -- add options here
    -- or leave it empty to use the default settings
    default = {
      -- 图片保存路径：以image/文件名/图片名.png
      dir_path = "images/" .. filemane,
      insert_mode_after_paste = false,
    },
    filetypes = {
      markdown = {
        url_encode_path = true, ---@type boolean | fun(): boolean
        template = "![$FILE_NAME_NO_EXT]($FILE_PATH)",
        download_images = false, ---@type boolean | fun(): boolean
      },
    },
  },
  keys = {
    { "<C-v>", "<cmd>PasteImage<cr>", desc = "Paste image from system clipboard" },
  },
}
